package Data::Semantic::URI::http;

use strict;
use warnings;


our $VERSION = '0.01';


use base qw(Data::Semantic::URI);


__PACKAGE__->mk_scalar_accessors(qw(scheme));


use constant REGEXP_KEYS => qw(URI HTTP);
use constant KEEP_KEYS   => qw(
    URI scheme host port abspath_full abspath_full_no_slash
    abspath_no_query query
);


sub flags {
    my $self = shift;
    my @flags = $self->SUPER::flags(@_);
    push @flags => sprintf("-scheme => '%s'", $self->scheme) if $self->scheme;
    @flags;
}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - semantics for HTTP URIs

=head1 SYNOPSIS

    my $obj = {% p.package %}->new;
    if ($obj->is_well_formed($value)) { ... }

=head1 DESCRIPTION

This class can tell whether a value is an HTTP URI, as defined by RFCs 2396
and 2616. The C<valid()> method will respect the C<scheme> attribute and the
inherited C<keep> boolean attribute.

See L<Regexp::Common::URI::http> for the meaning of C<scheme>.

If C<keep> is set, C<kept()> will return a hash with the following keys/value
pairs:

=over 4

=item URI

The complete URI.

=item scheme

The scheme.

=item host

The host (name or address).

=item port

The port (if any).

=item abspath_full

The absolute path, including the query and leading slash.

=item abspath_full_no_slash

The absolute path, including the query, without the leading slash.

=item abspath_no_query

The absolute path, without the query or leading slash.

=item query

The query, without the question mark.

=back

{% p.write_inheritance %}

=head1 METHODS

=over 4

{% p.write_methods %}

=back

{% PROCESS standard_pod %}

=head1 SEE ALSO

L<Regexp::Common::URI::ftp>

=cut

